<template>
  <div>
    <h1>父组件</h1>
    <Children :parent-name="name" @ccc="cusFn" />
  </div>
</template>

<script>
import Children from "./Children.vue";
export default {
  data() {
    return {
      name: "二狗",
    };
  },
  components: { Children },
  created() {
    setInterval(() => {
      this.name = Math.random()
        .toString(16)
        .substring(2, 10)
        .toLocaleUpperCase();
    }, 2000);
  },
  methods: {
    cusFn(params) {
      console.log("方法被调用了", params);
    },
  },
};
</script>
